package com.yjhb.android.sbz.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.yjhb.android.sbz.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 创建者 zx
 * 创建时间 2021/1/15 9:47
 */
public class RewardView extends FrameLayout {
    private final String TAG = "RewardView";
    @BindView(R.id.top_tv)
    TextView topTv;
    @BindView(R.id.bottom_tv)
    TextView bottomTv;

    public RewardView(Context context) {
        this(context, null);
    }

    public RewardView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public RewardView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
        TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.RewardView);
        topTv.setText(typedArray.getText(R.styleable.RewardView_topContent));
        bottomTv.setText(typedArray.getText(R.styleable.RewardView_bottomContent));
    }

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.view_reward, this, true);
        ButterKnife.bind(this);
    }


    public TextView getTopTv() {
        return topTv;
    }

    public TextView getBottomTv() {
        return bottomTv;
    }

}
